
import java.util.Comparator;
import java.util.Map;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author dttung
 */
public class TMLScoreComparator implements Comparator<Object> {
    Map theMapToSort;
    public TMLScoreComparator(Map map)
    {
        theMapToSort = map; // should pass tmlscores
    }
    @Override
    public int compare(Object team1, Object team2) {
        float totalyffscores1 = (Float)theMapToSort.get(team1);
        float totalyffscores2 = (Float)theMapToSort.get(team2);
        if (totalyffscores1 < totalyffscores2) return 1;
        if (totalyffscores2 < totalyffscores1) return -1;
        return 1;
    }
    
}
